<template>
	<view class="page">
		<!-- 		<view class="top">
			<view class="top-name" @click="show = true">
				<view>岳麓区</view>
				<u-icon name="arrow-down"></u-icon>
			</view>
			<u-line length="12" direction="col"></u-line>
			<view class="top-name">
				<view>门店类型</view>
				<u-icon name="arrow-down"></u-icon>
			</view>
			<u-line length="12" direction="col"></u-line>
			<view class="top-name">
				<view>综合排序</view>
				<u-icon name="arrow-down"></u-icon>
			</view>
			<u-line length="12" direction="col"></u-line>
			<view class="top-name">
				<view>筛选</view>
				<u-icon name="arrow-down"></u-icon>
			</view>
		</view> -->

		<view class="content" v-for="(item,index) in content" :key="index" >
			<image class="img" :src="item.img"></image>
			<view class="content1">
				<view class="content-name">{{item.name}}</view>
				<view class="content-time">营业时间：{{item.startTime}}-
					{{item.endTime}}
				</view>
				<view class="content-map">{{item.address}}</view>
			</view>
			<view class="icon">
				<image @click="map(item)" style="width:48rpx ; height: 48rpx; margin-right: 20rpx;"
					src="/static/home/map.png"></image>
				<!-- <image @click="phone(item)" style="width:48rpx ; height: 48rpx;" src="../../../static/20230328061106_d73a2.jpg"></image> -->
			</view>
			<view class="map">{{item.distanceValue}}km</view>
		</view>
		<u-action-sheet :actions="list" @select="selectClick" :show="show"></u-action-sheet>
		<u-loadmore loadmoreText="没有更多了" color="#a2a2a2" lineColor="#a2a2a2" dashed line />
	</view>
</template>

<script>
	import {
		apigetStoreByLocatio
	} from '@/api/shop.js'
	export default {
		data() {
			return {
				// status: 'loadmore',
				// loadingText: '努力加载中',
				// loadmoreText: '轻轻上拉',
				// nomoreText: '实在没有了',
				list: [{
						name: '选项一'
					},
					{
						name: '选项二'
					}
				],
				show: false,
				content: [],
			}
		},
		onLoad() {
			this.StoreByLocatio()
		},
		methods: {
			map(li) {
				wx.openLocation({
					latitude: li.latitude, //维度
					longitude: li.longitude, //经度
					name: li.address, //目的地定位名称
					scale: 15, //缩放比例
					address: li.address //导航详细地址
				})
			},
			selectClick(e) {
				this.show = false
			},
			StoreByLocatio() {
				let map=uni.getStorageSync("setmap")
				let params = {
					latitude: map.latitude,
					longitude: map.longitude,
					limit: 10,
					radius: 100
				}
				apigetStoreByLocatio(params).then((res) => {
					console.log(res)
					this.content = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		padding: 20rpx;
		height: 84rpx;
		font-size: 28rpx;
		background-color: #fff;
		text-align: center;

		@include flex(row, space-between, center) .top-name {

			display: flex;
		}
	}

	.content {
		position: relative;
		width: 718rpx;
		// height: 230rpx;
		margin: 16rpx;
		padding: 26rpx 20rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 20rpx;
		display: flex;

		.icon {
			position: absolute;
			top: 100rpx;
			right: 30rpx;
		}

		.map {
			position: absolute;
			top: 170rpx;
			right: 20rpx;
			font-size: 28rpx;
			color: #7c7c7c;
		}

		.img {
			border-radius: 10rpx;
			width: 160rpx;
			height: 160rpx;
		}

		.content1 {
			width: 390rpx;
			margin-left: 20rpx;
			line-height: 40rpx;

			.content-name {
				font-size: 32rpx;
				font-weight: 600;
			}

			.content-time {
				font-size: 24rpx;
				color: #949494;
			}

			.content-map {
				font-size: 24rpx;
			}

		}
	}

	::v-deep .u-transition {
		// position: absolute !important; 
		top: 120rpx !important;
	}

	::v-deep .u-popup__content {
		// position: absolute !important; 

		background-color: rgba(0, 0, 0, 0.5) !important
	}
</style>